﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace logicunivesityinventorystore.Department
{
    public partial class PendingRejectedOrder : System.Web.UI.Page
    {
        string empid;
        protected void Page_Load(object sender, EventArgs e)
        {
            //empid = Session["UserName"].ToString();
            empid = User.Identity.Name;
            lblempIDhidden.Text = empid;
            gvReqList.DataBind();
            if (gvReqList.Rows.Count == 0)
            {
                lblList.Visible = false;
                ScriptManager.RegisterStartupScript(this, typeof(string), "Error", "alert('There is no list now!');window.location.href = 'HomePage_Department.aspx'", true);
            }
            gvReqList.DataBind();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {

        }

        protected void gvReqList_RowDataBound1(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                string formID = (e.Row.FindControl("lbtnFormId") as LinkButton).Text;
                (e.Row.FindControl("lbtnFormId") as LinkButton).Attributes.Add("onClick", "ShowEditModal('PendingRejectedPopUp.aspx?FormID=" + formID + "');");
            }
        }       
    }
}